//
//  GYPriceListVC.m
//  GYDemo
//
//  Created by Mrzhang on 2018/4/2.
//  Copyright © 2018年 mac. All rights reserved.
//

//
//                .-~~~~~~~~~-._       _.-~~~~~~~~~-.
//            __.'              ~.   .~              `.__
//          .'//                  \./                  \\`.
//        .'//                     |                     \\`.
//      .'// .-~"""""""~~~~-._     |     _,-~~~~"""""""~-. \\`.
//    .'//.-"                 `-.  |  .-'                 "-.\\`.
//  .'//______.============-..   \ | /   ..-============.______\\`.
//.'______________________________\|/______________________________`.
//
//

#import "GYPriceListVC.h"
#import "Head.h"
#import "GYMarketListModel.h"
@interface GYPriceListVC ()
@property(nonatomic,strong)UIView* topView;
@end

@implementation GYPriceListVC
#pragma mark - getter and setter
-(UIView *)topView
{
    if (!_topView) {
        _topView=[[UIView alloc] init];
        _topView.frame=WFCGRectMake(0, 0, 375, 40);
        _topView.backgroundColor = RGBACOLOR(245, 245, 245, 1);
    }
    return _topView;
}
#pragma mark - event
#pragma mark - method
-(void)initTopView
{
    
}
#pragma mark - life
- (void)viewDidLoad {
    [super viewDidLoad];
    self.title=@"";
//    self.edgesForExtendedLayout = UIRectEdgeNone;
//    self.automaticallyAdjustsScrollViewInsets = NO;
    self.view.backgroundColor = [UIColor whiteColor];
    
    [self.view addSubview:self.topView];
    
    UILabel *titleLab_1 = [[UILabel alloc] init];
    titleLab_1.frame = CGRectMake(10, 0, 100, _topView.height);
    titleLab_1.textColor = Main_Color_LightGray;
    titleLab_1.font = SYSTEMFONT(14);
    titleLab_1.textAlignment = NSTextAlignmentLeft;
    titleLab_1.text = @"产品种类";
    [_topView addSubview:titleLab_1];
    
    UILabel *titleLab_2 = [[UILabel alloc] init];
    titleLab_2.frame = WFCGRectMake(0, 0, 375, _topView.height);
    titleLab_2.textColor = Main_Color_LightGray;
    titleLab_2.font = SYSTEMFONT(14);
    titleLab_2.textAlignment = NSTextAlignmentCenter;
    titleLab_2.text = @"价格";
    [_topView addSubview:titleLab_2];
    
    UILabel *titleLab_3 = [[UILabel alloc] init];
    titleLab_3.frame = CGRectMake(self.view.width-10-100, 0, 100, _topView.height);
    titleLab_3.textColor =Main_Color_LightGray;
    titleLab_3.font = SYSTEMFONT(14);
    titleLab_3.textAlignment = NSTextAlignmentRight;
    titleLab_3.text = @"时间";
    [_topView addSubview:titleLab_3];
    

    self.baseTable.separatorStyle=UITableViewCellSeparatorStyleSingleLine;
    self.baseTable.backgroundColor=[UIColor whiteColor];
    self.baseTable.height=self.view.height-WFCGFloatY(40)-GY_Nav_height-40;
    self.baseTable.y=WFCGFloatY(40);
    [self.view addSubview:self.baseTable];
    

}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma mark - UITableViewDelegate
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    //return 20;
    return [_datas count];
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    return WFCGFloatY(40);
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *CellID = @"CellIDThird";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellID];
    if (cell == nil) {
        cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellID];
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
        cell.backgroundColor=[UIColor whiteColor];

    }
    [cell.contentView removeAllSubviews];

    float ww=375/3;
    
    NSDictionary* dic=self.datas[indexPath.row];
    
    UILabel *titleLab_1 = [[UILabel alloc] init];
    titleLab_1.frame = WFCGRectMake(10, 0, ww-10, 40);
    titleLab_1.textColor = Main_Color_Gray;
    titleLab_1.font = SYSTEMFONT(14);
    titleLab_1.textAlignment = NSTextAlignmentLeft;
    titleLab_1.text =[NSString stringWithFormat:@"%@",[dic objectForKey:@"name"]];
    [cell.contentView addSubview:titleLab_1];

    UILabel *titleLab_2 = [[UILabel alloc] init];
    titleLab_2.frame = WFCGRectMake(375/2-ww/2, 0, ww, 40);
    titleLab_2.textColor = Main_Color_Gray;
    titleLab_2.font = SYSTEMFONT(14);
    titleLab_2.textAlignment = NSTextAlignmentCenter;
    titleLab_2.text =[NSString stringWithFormat:@"%@元",[dic objectForKey:@"price"]];
    [cell.contentView addSubview:titleLab_2];

    UILabel *titleLab_3 = [[UILabel alloc] init];
    titleLab_3.frame = WFCGRectMake(375-10-ww, 0, ww, 40);
    titleLab_3.textColor =Main_Color_Gray;
    titleLab_3.font = SYSTEMFONT(14);
    titleLab_3.textAlignment = NSTextAlignmentRight;
    titleLab_3.text = [NSString stringWithFormat:@"%@",[dic objectForKey:@"transdate"]];
    [cell.contentView addSubview:titleLab_3];

    return cell;
}



@end


/*
 11111111111111111111111111111111111111001111111111111111111111111
 11111111111111111111111111111111111100011111111111111111111111111
 11111111111111111111111111111111100001111111111111111111111111111
 11111111111111111111111111111110000111111111111111111111111111111
 11111111111111111111111111111000000111111111111111111111111111111
 11111111111111111111111111100000011110001100000000000000011111111
 11111111111111111100000000000000000000000000000000011111111111111
 11111111111111110111000000000000000000000000000011111111111111111
 11111111111111111111111000000000000000000000000000000000111111111
 11111111111111111110000000000000000000000000000000111111111111111
 11111111111111111100011100000000000000000000000000000111111111111
 11111111111111100000110000000000011000000000000000000011111111111
 11111111111111000000000000000100111100000000000001100000111111111
 11111111110000000000000000001110111110000000000000111000011111111
 11111111000000000000000000011111111100000000000000011110001111111
 11111110000000011111111111111111111100000000000000001111100111111
 11111111000001111111111111111111110000000000000000001111111111111
 11111111110111111111111111111100000000000000000000000111111111111
 11111111111111110000000000000000000000000000000000000111111111111
 11111111111111111100000000000000000000000000001100000111111111111
 11111111111111000000000000000000000000000000111100000111111111111
 11111111111000000000000000000000000000000001111110000111111111111
 11111111100000000000000000000000000000001111111110000111111111111
 11111110000000000000000000000000000000111111111110000111111111111
 11111100000000000000000001110000001111111111111110001111111111111
 11111000000000000000011111111111111111111111111110011111111111111
 11110000000000000001111111111111111100111111111111111111111111111
 11100000000000000011111111111111111111100001111111111111111111111
 11100000000001000111111111111111111111111000001111111111111111111
 11000000000001100111111111111111111111111110000000111111111111111
 11000000000000111011111111111100011111000011100000001111111111111
 11000000000000011111111111111111000111110000000000000011111111111
 11000000000000000011111111111111000000000000000000000000111111111
 11001000000000000000001111111110000000000000000000000000001111111
 11100110000000000001111111110000000000000000111000000000000111111
 11110110000000000000000000000000000000000111111111110000000011111
 11111110000000000000000000000000000000001111111111111100000001111
 11111110000010000000000000000001100000000111011111111110000001111
 11111111000111110000000000000111110000000000111111111110110000111
 11111110001111111100010000000001111100000111111111111111110000111
 11111110001111111111111110000000111111100000000111111111111000111
 11111111001111111111111111111000000111111111111111111111111100011
 11111111101111111111111111111110000111111111111111111111111001111
 11111111111111111111111111111110001111111111111111111111100111111
 11111111111111111111111111111111001111111111111111111111001111111
 11111111111111111111111111111111100111111111111111111111111111111
 11111111111111111111111111111111110111111111111111111111111111111
 
 
 */
